﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WellcomeMyBlog.Models.Services.Menu3Services;

namespace WellcomeMyBlog.Helper
{
    public class FindIdMax2
    {
        private IMenu3Repository _re;
        public FindIdMax2()
        {
            _re = new Menu3Repository();
        }
        public FindIdMax2(IMenu3Repository re)
        {
            _re = re;
        }
        public int Find()
        {
            int[] a=new int[_re.FindAlldata().Count()];
            int i = 0;
            foreach (var c in _re.FindAlldata())
            {
                a[i] = c.Id;
                i++;
            }
            return a[i-1];
        }
    }
}
